home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Transactor
/
Transactor_12_1986_Transactor_Publishing.d64
/
kernal who.src3
< prev
next >
Wrap
Text File
|
2023-02-26
|
2KB
|
44 lines
; program 3
; load screen contents from disk using name found in first variable
; declared in basic program calling this routine. The first variable
; should be a string variable.
;
start ldy #$02 ;offset to string length
lda ($2d),y ;get string length
beq exit ;zero length, quit while ahead
pha ;save length on stack
iny ;increment index
lda ($2d),y ;get low address of string
tax ;put in .x
iny ;increment index
lda ($2d),y ;get high order pointer
tay ;put in .y
pla ;pull length from stack
jsr $ffbd ;setnam: set command string
lda #$01 ;logical file #1
ldx #$08 ;device #8
ldy #$02 ;secondary address
jsr $ffba ;setlfs: set logical file
jsr $ffc0 ;open
bcs exit ;if carry set then error out
ldx #$01 ;file number
jsr $ffc6 ;chkin: set input channel to file 1
ldy #$00 ;zero index
sty $fc ;zero index temp
sty $fd ;set pointer low byte
lda #$04 ;start of screen high byte
sta $fe ;set pointer high byte
loop jsr $ffe4 ;getin: get a byte from disk
ldy $fc ;get index temp
sta ($fd),y ;store byte on screen
inc $fc ;increment index
bne loop ;not 256 yet?
inc $fe ;increment high byte of pointer
lda $fe ;get pointer high byte
cmp #$08 ;done four pages yet?
bcc loop ;if carry clear then no
lda #$01 ;file number 1
jsr $ffc3 ;close: close the file
exit jsr $ffe7 ;clall: restore default i/o
rts ;return to basic